
#pragma once

#include <SColor.h>
using namespace irr;
using namespace video;

namespace Irrlicht
{
	namespace Net
	{
		namespace Video
		{
			public ref class Color
			{
			internal:
				SColor* insider;

			public:
				Color()
				{
					insider = new SColor();
				}
				Color(unsigned int a, unsigned int r, unsigned int g, unsigned int b)
				{
					insider = new SColor(a, r, g, b);
				}
				Color(unsigned int clr)
				{
					insider = new SColor(clr);
				}
				Color(SColor* color)
				{
					insider = color;
				}

				property unsigned int Alpha
				{
					unsigned int get()
					{
						return insider->getAlpha();
					}
					void set(unsigned int a)
					{
						insider->setAlpha(a);
					}
				}
				property unsigned int Red
				{
					unsigned int get()
					{
						return insider->getRed();
					}
					void set(unsigned int r)
					{
						insider->setRed(r);
					}
				}
				property unsigned int Green
				{
					unsigned int get()
					{
						return insider->getGreen();
					}
					void set(unsigned int g)
					{
						insider->setGreen(g);
					}
				}
				property unsigned int Blue
				{
					unsigned int get()
					{
						return insider->getBlue();
					}
					void set(unsigned int b)
					{
						insider->setBlue(b);
					}
				}

				property float Brightness
				{
					float get()
					{
						return insider->getLightness();
					}
				}
				property float Luminance
				{
					float get()
					{
						return insider->getLuminance();
					}
				}
				property unsigned int Average
				{
					unsigned int get()
					{
						return insider->getAverage();
					}
				}

				unsigned short ToA1R5G5B5()
				{
					return insider->toA1R5G5B5();
				}
				void ToOpenGLColor(unsigned char* dest)
				{
					insider->toOpenGLColor(dest);
				}
				
				void Set(unsigned int a, unsigned int r, unsigned int g, unsigned int b)
				{
					insider->set(a, r, g, b);
				}
				void Set(unsigned int col)
				{
					insider->set(col);
				}

				Color^ Interpolated(Color^ other, float fd)
				{
					return gcnew Color(/*insider->getInterpolated((*other->insider), fd)*/);
				}
			};
		}
	}
}